FROM ad_adp_base:2.3

ENV APP_HOME /srv/app
WORKDIR ${APP_HOME}

COPY requirements.txt /tmp/requirements.txt

RUN set -ex \
    && apt-get update && apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall netbase && apt-get install -y libcairo2-dev \
    && ln -s /usr/bin/pip3 /usr/bin/pip \
    && pip install -r /tmp/requirements.txt \
    && pip install 'flask[async]'==2.1.3

COPY . ${APP_HOME}

RUN set -ex \
    && mkdir ${APP_HOME}/logs || true && touch ${APP_HOME}/logs/.touchforlogrotate \
    && find . -name "*.sh" | xargs chmod +x
